import request from '@/utils/request'
import {SysRoleQuery, SysRoleParams} from "@/common/interface/role.ts";

// 查询角色信息列表
export function listRole(query: SysRoleQuery) {
    return request({
        url: '/system/role/list',
        method: 'get',
        params: query
    })
}

// 查询角色信息详细
export function getRole(id: number) {
    return request({
        url: '/system/role/' + id,
        method: 'get'
    })
}

// 新增角色信息
export function addRole(data: SysRoleParams) {
    return request({
        url: '/system/role',
        method: 'post',
        data: data
    })
}

// 修改角色信息
export function updateRole(data: SysRoleParams) {
    return request({
        url: '/system/role',
        method: 'put',
        data: data
    })
}

// 删除角色信息
export function delRole(id: number[]) {
    return request({
        url: '/system/role/' + id,
        method: 'delete'
    })
}
